import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],

  resolve: {
    // 配置路径别名
    // 还需要在jsconfig.json文件中配置baseUrl和paths，才会有路径提示
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },

  css: {
    preprocessorOptions: {
      scss: {
        // 自动引入包含全局变量的scss
        additionalData: `@import "./src/styles/variable.scss";`,
      },
    },
  },
})
